﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewFund.aspx.cs" Inherits="FundRaising.GUI.NewFund" MasterPageFile="~/GUI/NewEntityMaster.Master" %>


<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">

        
                             

    <table dir="rtl" style="width:100%;">
        <tr>
            <td style="width: 264px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr dir="rtl">
            <td style="width: 264px">
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                    DataKeyNames="SerialNum" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
                    Height="50px" Width="389px">
                    <Fields>
                        <asp:BoundField DataField="SerialNum" HeaderText="SerialNum" ReadOnly="True" 
                            SortExpression="SerialNum" Visible="False" />
                        <asp:TemplateField HeaderText="שם קרן" SortExpression="FundName">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FundName") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("FundName") %>'></asp:TextBox>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Bind("FundName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="תחום פעילות" SortExpression="DomainName">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("DomainName") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:DropDownList ID="DropDownList1" runat="server" 
                                    DataSourceID="SqlDataSource1" DataTextField="DomainName" 
                                    DataValueField="DomainName" Height="16px" Width="124px">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                                    SelectCommand="SELECT [DomainName] FROM [Domain]"></asp:SqlDataSource>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("DomainName") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="NameContact" HeaderText="שם איש קשר" 
                            SortExpression="NameContact" />
                        <asp:BoundField DataField="PhoneNum" HeaderText="טלפון" 
                            SortExpression="PhoneNum" />
                        <asp:BoundField DataField="FaxNum" HeaderText="פאקס" SortExpression="FaxNum" />
                        <asp:BoundField DataField="Email" HeaderText="מייל" SortExpression="Email" />
                        <asp:BoundField DataField="Address" HeaderText="כתובת" 
                            SortExpression="Address" />
                        <asp:BoundField DataField="CountryOfOrigin" HeaderText="מדינה" 
                            SortExpression="CountryOfOrigin" />
                        <asp:BoundField DataField="DeadLine" HeaderText="דד ליין" 
                            SortExpression="DeadLine" />
                        <asp:BoundField DataField="SiteLink" HeaderText="קישור לאתר קרן" 
                            SortExpression="SiteLink" />
                        <asp:TemplateField ShowHeader="False">
                            <InsertItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                                    CommandName="Insert" onclick="LinkButton1_Click" Text="הוסף חדש"></asp:LinkButton>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" 
                                    CausesValidation="False" CommandName="Cancel" Text="בטל"></asp:LinkButton>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                    CommandName="New" Text="New"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Fields>
                </asp:DetailsView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConflictDetection="CompareAllValues" 
                    ConnectionString="<%$ ConnectionStrings:Eden-DatabaseConnectionString3 %>" 
                    DeleteCommand="DELETE FROM [FundContacts] WHERE [SerialNum] = @original_SerialNum AND (([FundName] = @original_FundName) OR ([FundName] IS NULL AND @original_FundName IS NULL)) AND (([NameContact] = @original_NameContact) OR ([NameContact] IS NULL AND @original_NameContact IS NULL)) AND (([PhoneNum] = @original_PhoneNum) OR ([PhoneNum] IS NULL AND @original_PhoneNum IS NULL)) AND (([FaxNum] = @original_FaxNum) OR ([FaxNum] IS NULL AND @original_FaxNum IS NULL)) AND (([Email] = @original_Email) OR ([Email] IS NULL AND @original_Email IS NULL)) AND (([SiteLink] = @original_SiteLink) OR ([SiteLink] IS NULL AND @original_SiteLink IS NULL)) AND (([Address] = @original_Address) OR ([Address] IS NULL AND @original_Address IS NULL)) AND (([DeadLine] = @original_DeadLine) OR ([DeadLine] IS NULL AND @original_DeadLine IS NULL)) AND (([CountryOfOrigin] = @original_CountryOfOrigin) OR ([CountryOfOrigin] IS NULL AND @original_CountryOfOrigin IS NULL)) AND (([DomainName] = @original_DomainName) OR ([DomainName] IS NULL AND @original_DomainName IS NULL))" 
                    InsertCommand="INSERT INTO [FundContacts] ([SerialNum], [FundName], [NameContact], [PhoneNum], [FaxNum], [Email], [SiteLink], [Address], [DeadLine], [CountryOfOrigin], [DomainName]) VALUES (@SerialNum, @FundName, @NameContact, @PhoneNum, @FaxNum, @Email, @SiteLink, @Address, @DeadLine, @CountryOfOrigin, @DomainName)" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectCommand="SELECT * FROM [FundContacts]" 
                    UpdateCommand="UPDATE [FundContacts] SET [FundName] = @FundName, [NameContact] = @NameContact, [PhoneNum] = @PhoneNum, [FaxNum] = @FaxNum, [Email] = @Email, [SiteLink] = @SiteLink, [Address] = @Address, [DeadLine] = @DeadLine, [CountryOfOrigin] = @CountryOfOrigin, [DomainName] = @DomainName WHERE [SerialNum] = @original_SerialNum AND (([FundName] = @original_FundName) OR ([FundName] IS NULL AND @original_FundName IS NULL)) AND (([NameContact] = @original_NameContact) OR ([NameContact] IS NULL AND @original_NameContact IS NULL)) AND (([PhoneNum] = @original_PhoneNum) OR ([PhoneNum] IS NULL AND @original_PhoneNum IS NULL)) AND (([FaxNum] = @original_FaxNum) OR ([FaxNum] IS NULL AND @original_FaxNum IS NULL)) AND (([Email] = @original_Email) OR ([Email] IS NULL AND @original_Email IS NULL)) AND (([SiteLink] = @original_SiteLink) OR ([SiteLink] IS NULL AND @original_SiteLink IS NULL)) AND (([Address] = @original_Address) OR ([Address] IS NULL AND @original_Address IS NULL)) AND (([DeadLine] = @original_DeadLine) OR ([DeadLine] IS NULL AND @original_DeadLine IS NULL)) AND (([CountryOfOrigin] = @original_CountryOfOrigin) OR ([CountryOfOrigin] IS NULL AND @original_CountryOfOrigin IS NULL)) AND (([DomainName] = @original_DomainName) OR ([DomainName] IS NULL AND @original_DomainName IS NULL))">
                    <DeleteParameters>
                        <asp:Parameter Name="original_SerialNum" Type="Object" />
                        <asp:Parameter Name="original_FundName" Type="String" />
                        <asp:Parameter Name="original_NameContact" Type="String" />
                        <asp:Parameter Name="original_PhoneNum" Type="String" />
                        <asp:Parameter Name="original_FaxNum" Type="String" />
                        <asp:Parameter Name="original_Email" Type="String" />
                        <asp:Parameter Name="original_SiteLink" Type="String" />
                        <asp:Parameter Name="original_Address" Type="String" />
                        <asp:Parameter Name="original_DeadLine" Type="String" />
                        <asp:Parameter Name="original_CountryOfOrigin" Type="String" />
                        <asp:Parameter Name="original_DomainName" Type="String" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="FundName" Type="String" />
                        <asp:Parameter Name="NameContact" Type="String" />
                        <asp:Parameter Name="PhoneNum" Type="String" />
                        <asp:Parameter Name="FaxNum" Type="String" />
                        <asp:Parameter Name="Email" Type="String" />
                        <asp:Parameter Name="SiteLink" Type="String" />
                        <asp:Parameter Name="Address" Type="String" />
                        <asp:Parameter Name="DeadLine" Type="String" />
                        <asp:Parameter Name="CountryOfOrigin" Type="String" />
                        <asp:Parameter Name="DomainName" Type="String" />
                        <asp:Parameter Name="original_SerialNum" Type="Object" />
                        <asp:Parameter Name="original_FundName" Type="String" />
                        <asp:Parameter Name="original_NameContact" Type="String" />
                        <asp:Parameter Name="original_PhoneNum" Type="String" />
                        <asp:Parameter Name="original_FaxNum" Type="String" />
                        <asp:Parameter Name="original_Email" Type="String" />
                        <asp:Parameter Name="original_SiteLink" Type="String" />
                        <asp:Parameter Name="original_Address" Type="String" />
                        <asp:Parameter Name="original_DeadLine" Type="String" />
                        <asp:Parameter Name="original_CountryOfOrigin" Type="String" />
                        <asp:Parameter Name="original_DomainName" Type="String" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="SerialNum" Type="Object" />
                        <asp:Parameter Name="FundName" Type="String" />
                        <asp:Parameter Name="NameContact" Type="String" />
                        <asp:Parameter Name="PhoneNum" Type="String" />
                        <asp:Parameter Name="FaxNum" Type="String" />
                        <asp:Parameter Name="Email" Type="String" />
                        <asp:Parameter Name="SiteLink" Type="String" />
                        <asp:Parameter Name="Address" Type="String" />
                        <asp:Parameter Name="DeadLine" Type="String" />
                        <asp:Parameter Name="CountryOfOrigin" Type="String" />
                        <asp:Parameter Name="DomainName" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td style="width: 264px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>

        
                             

</asp:Content>
